1. Field of the Invention
This invention relates generally to file systems. More particularly, the invention relates to a system and method for mounting a file system on multiple host computers.
2. Description of the Related Art
Computer systems generally store files on storage devices such as disk drives, tape drives, or optical drives, where the files are organized as a file system. File systems typically use directories or folders so that each file is located in one of the directories. The directories are often organized as a hierarchy. For example, a file system may have a root directory, the root directory may have sub-directories, and the sub-directories of the root directory may in turn have sub-directories, etc. Each file in the file system may have a pathname that specifies the hierarchical sequence of directories that lead to the file.
Software applications executing on the computer system typically request the file system to create files and write data to the files. The data written to the files is also referred to herein as user data. In addition to the user data that is written to the files, the file system also maintains metadata for managing the user data. For example, the metadata may include file descriptors, e.g., inodes or other data structures, that correspond to the various files in the file system. The inode for a file stores information about the file, such as the number of bytes in the file, protection and permission information, a link count that specifies the number of hard links to the file, storage locations of data blocks for the file's user data, the dates and times when the file was created, last accessed, and modified, etc.
Each directory may have a table of directory entries that maps the names of the files in that directory to their corresponding metadata (e.g., inodes or other file descriptors). A software application may access a file if it knows the pathname of the file. For example, the sequence of directories leading to the file may be traversed until the file's directory is reached, and the table of directory entries for the file's directory may be consulted to map the name of the file to the file's corresponding inode or other metadata. The file's metadata may then be accessed, and the information stored therein may be used to access the file's user data. For example, as noted above, the metadata may specify storage locations, e.g., addresses, of data blocks (e.g., data blocks on a disk drive or other storage device) that hold the file's user data. Thus, the data blocks may be accessed, for example, to read data from the file or to append new data to the file.
In some applications it would be desirable to mount a file system on multiple computer systems. However, two different computer systems typically cannot mount the same file system without introducing the potential for corrupting the file system or returning the wrong data on a file read.